package com.anime.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.animes.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import model.AnimeYHSearchModel;
import pic.PicLoadManager;

public  class YHSearchAnimeAdapter  extends BaseQuickAdapter<AnimeYHSearchModel.DataBean.ListBean, BaseViewHolder> {
    public YHSearchAnimeAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<AnimeYHSearchModel.DataBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AnimeYHSearchModel.DataBean.ListBean item) {
        ImageView pig = helper.itemView.findViewById(R.id.iv_pig);
      PicLoadManager.loadPicture(item.getPic(), pig);

        TextView tvName = helper.itemView.findViewById(R.id.tv_name);
        helper.setText(R.id.tv_name, item.getName());

        helper.setText(R.id.tv_time, item.getRemarks());

        TextView tv_descs = helper.itemView.findViewById(R.id.tv_descs);
//        tv_descs.setText(item.getDescs());



        tvName.setSelected(true);
        tv_descs.setSelected(true);
    }
}
